<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button>点击获取英雄联盟数据</button>
    <a href="https://lol.qq.com/data/info-heros.shtml">查看英雄联盟网站</a>
    <script src="./libs/jquery-1.12.4.min.js"></script>
    <script>
      // 由于英雄联盟后端做了 CORS 设置，所以任何人都能通过 Ajax 请求到英雄联盟的数据
      $('button').on('click', () => {
        $.ajax({
          type: 'GET',
          url: 'https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js',
          dataType: 'json',
          success: (res) => {
            console.log(res)
          },
        })
      })
    </script>
  </body>
</html>
